﻿<include file="Public:header" />
<body class="layout">
<div id="index" >
  <div class="head"> <img src="__ROOT__/App/Vote/Static/images/top.png"/> </div>
  <!-- 他人参赛信息 -->
  <div class="information">
    <div class="person">
      <div class="person-head"> <a href="__URL__/index?activity_id=<?php echo $_GET['activity_id']?>"><img src="__ROOT__/App/Vote/Static/images/close.png" class="close"></a> <img src="{$Think.config.IMG_PATH}<if condition='$data.state eq 2'>{$data.img}<else/>/App/Vote/Static/img/404.jpg</if>" class="img" >
        <div class="shadow-tip"> <span class="person-no">NO:{$data.id}</span> <span class="person-name">{$data.name}</span> </div>
      </div>
      <div class="person-foot">
        <p>票数：<span class="vote-num">{$data.vote_num}</span></p>
        <p>参赛宣言：{$data.info}</p>
      </div>
    </div>
    <div class="three-btn">
      <button id="tovote" onClick="addvote();">我要投票</button>
      <button id="toback">点击返回</button>
    </div>
  </div>
</div>
<include file="Public:footer" /> 
<script charset="utf-8" type="text/javascript">
weixinShare({$signPackage},{$sharePackage_detail});
		/*$(function(){
		    //提示转发信息
	    	
	    	$("#toback").click(function(){
	    		location.href="index.html";
	    	});
	    	//投票
	    	$("#tovote").click(function(){
	    		if($(this).hasClass("hasvoted")){
	    			Util.showmsg("你已经投过票了")
		    	}
		    	else{
		    		var num=parseInt($(".vote-num").text());
		    		num+=1;
		    		$("#tovote").addClass("hasvoted");
	    			$(".vote-num").text(num)
		    	}
	    	});
		});*/
	var activityid = "{$_GET['activity_id']}";//活动ID
	var userid = "{$_GET['id']}";//用户ID
	$(function(){
		//返回首页
		$("#toback").click(function(){
			location.href="__URL__/index?activity_id="+activityid;
		});
		//转发
		$(".rule").click(function(){
	    	$(".rule-fixed").show();
	    });
	})
	//投票
	function addvote(){
		$.getJSON('__URL__/subVote', {activityid:activityid,userid:userid}, function(json){
			if(json.status ==1){
				$(".vote-num").html(json.data);
			}else{
				Util.showmsg(json.info);
			}
		})
	}


	</script>
